package com.biglead.feign.clients;

import com.biglead.common.pojo.MiniLoginCodeRequest;
import com.biglead.common.pojo.MiniLoginRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient("wx-service")
public interface FeignWxClient {

    /**
     * 通过code获取sessionKey
     * 解密用户的基本信息
     * @param loginDTO
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/wx/login_by_userinfo")
    Map<String,Object> miniLogin(@RequestBody MiniLoginRequest loginDTO);

    /**
     * 通过code 获取 openId 以及 sessionKey
     * @param loginDTO
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/wx/login_by_code")
    Map<String,Object> miniLoginBySession(@RequestBody MiniLoginCodeRequest loginDTO);

    /**
     * 通过code 获取 openId 以及 sessionKey
     * @param loginDTO
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/wx/login_by_phone")
    Map<String,Object> miniLoginByPhone(@RequestBody MiniLoginRequest loginDTO);

}
